/**
 * Created by sa on 2015/10/12.
 */


var cheerio = require('cheerio');
var superagent = require('superagent');


var url = "http://photo.weibo.com/photos/get_all?uid=3117780635&album_id=3609172263467128&type=3&page=1&count=30&__rnd=1443098675033";

superagent.get(url)
  .set("Cookie","UOR=developer.baidu.com,widget.weibo.com,i.youku.com; SINAGLOBAL=4287581958734.2266.1401076209294; ULV=1444642101022:8:1:1:7001572521270.449.1444642100993:1440769858089; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WF5P2doApvjuUv5W77mz62v5JpX5K2t; SUHB=0QSJxwbB700wk5; ALF=1476178110; un=13928720730; login_sid_t=cda25086450e32981cfbde51b7b1d66c; _s_tentry=passport.weibo.com; Apache=7001572521270.449.1444642100993; SUS=SID-2979378510-1444642110-GZ-63w7i-36f50564707e11c5c666d88ef5cf7feb; SUE=es%3D2e82916bb57136cfc30d92a38e977221%26ev%3Dv1%26es2%3D45e4a181a378dd4a295212b6646a02c1%26rs0%3DbVlN3qivk0d925Gm42VXH7kTPlZRg7dVMq2OD5VtVP1sRs4BMk4xVs59b6NFRXWwASWFQ1k%252Fp%252FMsUa1DHbYrsiVqEN49PxnYtztRtEIe8XCBCTkk0CVfysaA1a%252BcwZv%252FHu3f61yhBFOMhA%252BGqqKpKazPyPEJK8hRQeyU%252FExtMX0%253D%26rv%3D0; SUP=cv%3D1%26bt%3D1444642110%26et%3D1444728510%26d%3Dc909%26i%3D7feb%26us%3D1%26vf%3D0%26vt%3D0%26ac%3D0%26st%3D0%26uid%3D2979378510%26name%3D13928720730%2540sina.cn%26nick%3D%25E5%25A3%25B9%25E5%25B3%25B0_%26fmp%3D%26lcp%3D2015-06-03%252012%253A54%253A47; SUB=_2A257Hw1uDeTxGeRH7FsS9ybJyjyIHXVYbXmmrDV8PUNbuNBeLRHukW-bG0P8RSi8fsOOcm_tsA-6nm-37A..; SSOLoginState=1444642110; USRANIME=usrmdinst_16")
  .end(function (err, sres) {
    if (err) {
      console.log(err)
    }

    var $ = cheerio.load(sres.text);
    console.log(sres.text);
    var liList = $('li');
    ////获取标题
    //liList.each(function (idx, element) {
    //  //item_
    //  var id = $(element).attr('id');
    //  id = id.substring( 5 , id.length);
    //  var title = $(element).attr('title');
    //  var l_order = $(element).find('.l_order .num');
    //  var l_time = $(element).find('.l_time .num');
    //  var img = $(element).find('img').attr('_src');
    //
    //  var item = {};
    //  item.URL = 'http://player.youku.com/embed/' + id;
    //  item.ID = l_order.text();
    //  item.IMG = img;
    //  item.TIME = l_time.text();
    //  item.TITLE = title;
    //
    //  console.log(item);
    //
    //});
  });
